﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.SqlClient;
using System.Data;
using EnglishRemix.Services.Model;
using EnglishRemix.Services.Utility;

namespace EnglishRemix.Services.Facades
{
    public class TestFacade
    {
        public string getUser(String id)
        {
            List<SqlParameter> param = null;
            DBUtility.AddSqlParam(param, "@UserID", SqlDbType.BigInt, 123);
            DataSet ds = DBUtility.ExecuteDataset("Select Name from UserInfo where id = @UserID", param);

            if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
            {
                return ds.Tables[0].Rows[0].ToString();
            }
            return null;
        }
    }
}